<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<title>内部管理系统</title>
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<link rel="stylesheet" type="text/css"
	href="../../lib/bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css"
	href="../../stylesheets/theme.css">
<link rel="stylesheet"
	href="../../lib/font-awesome/css/font-awesome.css">
	
<script src="../../lib/jquery.min.js" type="text/javascript"></script>
<script src="../../lib/bootstrap/js/bootstrap.js"></script>
<script src="../../lib/jquery.validate.min.js"></script>
<script src="../../lib/jquery.cookie.js"></script>
<script src="../../lib/jquery.messager.js"></script>
<script src="../../js/init.js"></script>

<!-- <script src="../../lib/jquery.min.js" type="text/javascript"></script>
<script src="../../lib/bootstrap/js/bootstrap.js"></script>
<script src="../../lib/jquery.validate.min.js"></script>
<script src="../../lib/jquery.cookie.js"></script>
<script src="../../lib/messages_cn.js" type="text/javascript"></script>
<script src="../../js/init.js"></script>
<script src="../../lib/jquery.messager.js"></script>
<link rel="stylesheet" href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
<script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> -->

<style type="text/css">
#container {
	height: 300px;
	width: 400px;
}

.fl {
	float: left
}

select {
	width: 130px;
}
.title{
	font-size:18px;
	font-weight:bold;
}
</style>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="lib/html5.js"></script>
    <![endif]-->
</head>

<!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
<!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
<!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<body class="">
	<!--<![endif]-->

	<div class="navbar"></div>
	<div class="common"></div>

	<div class="sidebar-nav"></div>

	<div class="content">
		<div class="well">
			<ul class="nav nav-tabs">
				<li class="active"><a href="#userlist" data-toggle="tab">企业</a></li>
			</ul>
			<div id="myTabContent" class="tab-content">
					<div class="container-fluid">
						<div class="span8">
							<form class="form-horizontal" id="user_form">
								<div class="control-group title">实习岗位详情 </div>
								<input class=" hidden" id="companyId">
									<table class="table">
										<tr>
											<td><label class="control-label">岗位名称：</label></td>
											<td><label id="internshipName"></label></td>
											<td><label class="control-label">领域：</label></td>
											<td><label id="dicInternshipFieldName"></label></td>
										</tr>
										<tr>
											<td><label class="control-label">工资：</label></td>
											<td><label id="salary"></label></td>
											<td><label class="control-label">最低学历：</label></td>
											<td><label id="minEducationName"></label></td>
										</tr>
										<tr>
											<td><label class="control-label">地区：</label></td>
											<td><label id="district"></label></td>
											<td><label class="control-label">地址：</label></td>
											<td><label id="location"></label></td>
										</tr>
										<tr>
											<td><label class="control-label">招聘人数：</label></td>
											<td><label id="recruitingNumbers"></label></td>
											<td><label class="control-label">简介：</label></td>
											<td><label id="description"></label></td>
										</tr>
										<tr>
											<td><label class="control-label">岗位要求：</label></td>
											<td><label id="requirement"></label></td>
											<td><label class="control-label">电话：</label></td>
											<td><label id="tel"></label></td>
										</tr>
										<tr>
											<td><label class="control-label">生成时间：</label></td>
											<td><label id="createDate"></label></td>
											<td></td>
											<td></td>
										</tr>
									</table>
									
							</form>
						</div>
					</div>
					<div class="tab-pane active in" id="userlist">
					<div class="btn-toolbar">
						<form class="form-inline ">
							<div class="row">
								<div class="input-prepend input-append span2">
									<span class="add-on">每页</span> <input id="list_page_size"
										class="input-mini" type="text" value="15"> <span
										class="add-on">条</span>
								</div>

								<div class="input-prepend input-append span2">
									<span class="add-on">第</span> <input id="list_page"
										class="input-mini" type="text" value="1"> <span
										class="add-on">页</span>
								</div>


								<div class="span2 input-append btn-group">
									<button type="button" class="btn" id="btn_jump">跳转</button>
									<button type="button" class="btn" id="btn_prev">上一页</button>
									<button type="button" class="btn" id="btn_next">下一页</button>
								</div>

							</div>
						</form>
					</div>

					<div class="control-group">
						<label class="control-label">总数</label> <label id="total"></label>
						<input class=" hidden" id="user_id">
					</div>
					<div class="well" id="loadimgdiv">
						<table class="table">
							<thead>
								<tr>
									<th>姓名</th>
									<th>评论内容</th>
									<th>评论时间</th>
								</tr>
							</thead>
							<tbody id="user_tabel">

							</tbody>
						</table>
					</div>
					
					<div class="form-actions">
						<button id="btn-back" type="button" class="btn ">返回</button>
					</div>
				</div>
			</div>
		</div>
	</div>


	<script type="text/javascript">
	
		//初始化导航栏
		$(function() {
			initAdminNavBar();
			initCommon();
			initSideBar('user-management', 'company-list');
			$("#list_page_size").html(5);
			$("#list_page").html(1);
			reloadtable();

			$('#btn_jump').on('click', function(e) {
				reloadtable();
			});

			$('#btn_next').on('click', function(e) {
				var curpage = $('#list_page').val();
				$('#list_page').val(parseInt(curpage) + 1);
				reloadtable();
			});

			$('#btn_prev').on('click', function(e) {
				var curpage = $('#list_page').val();
				if (parseInt(curpage) > 1) {
					$('#list_page').val(parseInt(curpage) - 1);
					reloadtable();
				}
			});
		});
		
		//初始化用户详细信息
		function reloadtable() {
			var postId = getparastr('postId');
			var postFlag = getparastr('postFlag');
			if (postId != null && postId != "" && postFlag != null && postFlag != "") {//更新的情况下,给页面赋初始值
				$.ajax({
					contentType : "application/json",
					url : api_base_url
							+ "selectPostDetail.json?postId="
							+ postId + "&postFlag=" + postFlag,
					dataType : "json",
					success : function(data) {
						if (data.code == "200") {
							var internshipName = data.responseData.internshipName;
							var dicInternshipFieldName = data.responseData.dicInternshipFieldName;
							var salary = data.responseData.salary;
							var minEducationName = data.responseData.minEducationName;
							var recruitingNumbers = data.responseData.recruitingNumbers;
							var district = data.responseData.district;
							var location = data.responseData.location;
							var description = data.responseData.description;
							var createDate = data.responseData.createDate;
							var requirement = data.responseData.requirement;
							var tel = data.responseData.tel;
							$("#internshipName").html(internshipName);
							$("#salary").html(salary);
							$("#minEducationName").html(minEducationName);
							$("#recruitingNumbers").html(recruitingNumbers);
							$("#district").html(district);
							$("#location").html(location);
							$("#description").html(description);
							$("#tel").html(tel);
							$("#createDate").html(createDate);
							$("#requirement").html(requirement);
							$("#tel").html(tel);
							
							$('#list_page').html(pageSize)
							//refresh grid
							var rows = '';

							for (var int = 0; int < data.responseData.reviewList.length; int++) {
								rows += "<tr>";
								rows += "<td>"
										+ data.responseData.reviewList[int].personName
										+ "</td>";
								rows += "<td>"
										+ data.responseData.reviewList[int].review
										+ "</td>";
								rows += "<td>"
										+ data.responseData.reviewList[int].createTime
										+ "</td>";
								rows += "</tr>";
							}

							$('#user_tabel').html(rows);
							$('#list_cur_page').text(curPage);
						}
						$.messager.anim('fade', 1000);
					    $.messager.show('操作提示',data.msg, 5000);
					}
				});
			}  

		}


		//返回
		$('#btn-back').on('click', function() {
			history.back()
		});


	</script>

</body>
</html>


